package com.boot.unity.api.modules.training.controller;

import com.boot.unity.api.common.Result;
import com.boot.unity.api.modules.training.entity.Institution;
import com.boot.unity.api.modules.training.service.InstitutionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//@Api(tags = "驾校-培训机构")
//@RestController
//@RequestMapping("/api/institution")
@AllArgsConstructor
public class InstitutionController {
    private final InstitutionService institutionService;

    @ApiOperation(value = "新增及修改培训机构")
    @PostMapping
    public Result save(@RequestBody Institution institution) {
        return institutionService.save(institution);
    }

//    @GetMapping("/{id}")
//    @ApiOperation(value = "根据id获取")
//    public Institution get(@PathVariable Long id) {
//        return institutionDao.getById(id);
//    }
//
//    @PutMapping
//    @ApiOperation(value = "修改")
//    public Institution update(@RequestBody Institution institution) {
//        institutionDao.update(institution);
//        return institution;
//    }
//
//    @GetMapping
//    @ApiOperation(value = "列表")
//    public PageTableResponse list(PageTableRequest tableRequest) {
//        return new PageTableHandler(
//            request -> institutionDao.count(request.getParams()),
//            request -> institutionDao.list(request.getParams(), request.getOffset(), request.getLimit())
//        ).handle(tableRequest);
//    }
//
//    @DeleteMapping("/{id}")
//    @ApiOperation(value = "删除")
//    public void delete(@PathVariable Long id) {
//        institutionDao.delete(id);
//    }
}
